Skip to content

Sourcery Starbot ⭐ refactored tensorboy/pytorch_Realtime_Multi-Person_Pose_Estimation #158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SourceryAI
Copy link

Thanks for starring sourcery-ai/sourcery ✨ 🌟 ✨

Here's your pull request refactoring your most popular Python repo.

If you want Sourcery to refactor all your Python repos and incoming pull requests install our bot.

Review changes via command line

To manually merge these changes, make sure you're on the master branch, then run:

git fetch https://github.com/sourcery-ai-bot/pytorch_Realtime_Multi-Person_Pose_Estimation master
git merge --ff-only FETCH_HEAD
git reset HEAD^

Copy link
Author

@SourceryAI SourceryAI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Due to GitHub API limits, only the first 60 comments can be shown.

model = get_model('vgg19')
model = get_model('vgg19')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 62-124 refactored with the following changes:

model = get_model('vgg19')
model = get_model('vgg19')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 45-62 refactored with the following changes:

model = get_model('vgg19')
model = get_model('vgg19')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 43-64 refactored with the following changes:

Comment on lines -127 to +133
"image_id": 0,
"category_id": 1,
"keypoints": [],
"score": 0
"score": 0,
"image_id": image_id,
}
one_result["image_id"] = image_id
keypoints = np.zeros((18, 3))

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function append_result refactored with the following changes:

Comment on lines -168 to +179
"image_id": 0,
"category_id": 1,
"keypoints": [],
"score": 0
"score": 0,
"image_id": image_id,
}

one_result["image_id"] = image_id
keypoints = np.zeros((17, 3))

for part in range(17):
ind = ORDER_COCO[part]
index = int(person_to_joint_assoc[ridxPred, ind])

if -1 == index:
if index == -1:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function append_result_legacy refactored with the following changes:

Comment on lines -73 to +66
image = image.astype(np.uint8)

return image
return image.astype(np.uint8)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function inverse_inception_preprocess refactored with the following changes:

Comment on lines -96 to +87
if mode not in preprocessors:
return image
return preprocessors[mode](image)
return image if mode not in preprocessors else preprocessors[mode](image)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function preprocess refactored with the following changes:

Comment on lines -135 to +125
range_x = list(range(int(min_x), int(max_x), 1))
range_y = list(range(int(min_y), int(max_y), 1))
range_x = list(range(int(min_x), int(max_x)))
range_y = list(range(int(min_y), int(max_y)))
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function put_vec_maps refactored with the following changes:

if -1 == index:
if index == -1:
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function get_result refactored with the following changes:

Comment on lines -115 to -136
kp_lines = [
[keypoints.index('neck'), keypoints.index('right_hip')],
return [
[keypoints.index('neck'), keypoints.index('right_hip')],
[keypoints.index('right_hip'), keypoints.index('right_knee')],
[keypoints.index('right_knee'), keypoints.index('right_ankle')],
[keypoints.index('neck'), keypoints.index('left_hip')],
[keypoints.index('neck'), keypoints.index('left_hip')],
[keypoints.index('left_hip'), keypoints.index('left_knee')],
[keypoints.index('left_knee'), keypoints.index('left_ankle')],
[keypoints.index('neck'), keypoints.index('right_shoulder')],
[keypoints.index('neck'), keypoints.index('right_shoulder')],
[keypoints.index('right_shoulder'), keypoints.index('right_elbow')],
[keypoints.index('right_elbow'), keypoints.index('right_wrist')],
[keypoints.index('right_shoulder'), keypoints.index('right_eye')],
[keypoints.index('neck'), keypoints.index('left_shoulder')],
[keypoints.index('right_elbow'), keypoints.index('right_wrist')],
[keypoints.index('right_shoulder'), keypoints.index('right_eye')],
[keypoints.index('neck'), keypoints.index('left_shoulder')],
[keypoints.index('left_shoulder'), keypoints.index('left_elbow')],
[keypoints.index('left_elbow'), keypoints.index('left_wrist')],
[keypoints.index('left_shoulder'), keypoints.index('left_eye')],
[keypoints.index('neck'), keypoints.index('nose')],
[keypoints.index('left_shoulder'), keypoints.index('left_eye')],
[keypoints.index('neck'), keypoints.index('nose')],
[keypoints.index('nose'), keypoints.index('right_eye')],
[keypoints.index('nose'), keypoints.index('left_eye')],
[keypoints.index('nose'), keypoints.index('left_eye')],
[keypoints.index('right_eye'), keypoints.index('right_ear')],
[keypoints.index('left_eye'), keypoints.index('left_ear')]
[keypoints.index('left_eye'), keypoints.index('left_ear')],
]
return kp_lines
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function kp_connections refactored with the following changes:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant